﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Game_MVC3.Models;

namespace Game_MVC3.Controllers
{ 
    public class MainController : Controller
    {
        private GameDbContext db = new GameDbContext();

        //
        // GET: /Main/
        public ViewResult Index()
        {
            return View(db.NewsList.OrderByDescending(n => n.Date).Take(5).ToList());
        }

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}